package com.yc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.entity.Record;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB Mapper 接口
 * </p>
 *
 * @author zzw
 * @since 2022-06-18
 */
public interface RecordMapper extends BaseMapper<Record> {
    @Select("SELECT * from record where uid=#{uid} order by rcdate desc")
    public List<Record> queryByUid(Integer uid);

    @Delete("DELETE from record WHERE rcid=#{rcid}")
    public Integer deleteByRcid(Integer rcid);

    @Delete("DELETE from record WHERE uid=#{uid}")
    public Integer deleteAllPlays(Integer uid);

    @Select("SELECT * from record where uid=#{uid} and ctid=#{ctid}")
    public List<Record> queryByUidAndCtid(Integer uid,Integer ctid);
}
